package nc.bs.mmpac.sumpickm.rule;

import nc.impl.pubapp.pattern.rule.IRule;
import nc.jdbc.framework.generator.SequenceGenerator;
import nc.util.mmf.framework.base.MMValueCheck;
import nc.vo.mmpac.sumpickm.entity.AggSumPickmVO;
import nc.vo.mmpac.sumpickm.entity.SumPickmRelVO;
import nc.vo.pub.VOStatus;

public class SumPickmFillRelVORule  implements IRule<AggSumPickmVO>  {

	@Override
	public void process(AggSumPickmVO[] vos) {
		if (MMValueCheck.isEmpty(vos)) {
            return;
        }

        for (AggSumPickmVO vo : vos) {
        	SumPickmRelVO[] relVOs = (SumPickmRelVO[]) vo.getChildren(SumPickmRelVO.class);
            if (MMValueCheck.isEmpty(relVOs)) {
              continue ;
            }
            for(SumPickmRelVO relVO:relVOs)
            {
            	if(relVO.getStatus()==VOStatus.NEW)
            	{
            	
            		 relVO.setPk_sumpickm_rel( new SequenceGenerator().generate()) ;
            	}
            }
            
        }
		
		
	}

}
